<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{/common/header::header-head}">
</head>
<body>
<div th:replace="~{/common/header::header-body}"></div>

<div class="container mb-3 mt-3">
    <form method="post" th:action="@{'/back/article/publish/'+${article==null?'':article.getId()}}">
        <label class="form-label" for="title">标题</label>
        <input class="form-control" id="title" name="title" required th:value="${article==null?'':article.getTitle()}"
               type="text">

        <label class="form-label" for="category">分类</label>
        <input class="form-control" id="category" name="category" required
               th:value="${article==null?'':article.getCategory()}" type="text">

        <label class="form-label" for="comment">内容</label>
        <textarea class="form-control" id="comment" name="content" required rows="5"
                  th:text="${article==null?'':article.getContent()}"></textarea>
        <button class="btn btn-primary" type="submit">发布</button>
    </form>
</div>

</body>
</html>